'use strict'

const Controller = require('egg').Controller
const PKG = require('../../package.json')

class HomeController extends Controller {
  async index() {
    const { ctx } = this

    await ctx.model.Financings.sync({ alter: true })
    // await ctx.model.Seller.sync({ alter: true })
    // await ctx.model.Brand.sync({ alter: true })
    // await ctx.model.BrandModel.sync({ alter: true })
    // await ctx.model.Contact.sync({ alter: true })
    // await ctx.model.Shop.sync({ alter: true })
    // await ctx.model.Media.sync({ alter: true })
    const { name, version } = PKG

    ctx.body = { name, version }
  }
}

module.exports = HomeController
